package mysql

import "gorm.io/gorm"

type Good struct {
	gorm.Model
	GoodTitle   string `gorm:"type:varchar(40);not null;index:ip_idx"`
	GoodPrice   int    `gorm:"type:int(11);not null;"`
	GoodStock   int    `gorm:"type:int(11);not null;"`
	GoodStatus  int    `gorm:"type:int(11);not null;"`
	LikeCollect int    `gorm:"type:int(11);not null;"`
}

func (G *Good) GoodFind(GoodsId int) error {
	return DB.Debug().Model(&G).Where("id = ?", GoodsId).Find(&G).Error
}
